// Thud - a dynamic object-oriented language
// Copyright (C) 2009,2010 David H. Hovemeyer <david.hovemeyer@gmail.com>

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

// Visitor interface for Abstract Syntax Tree Nodes

#ifndef FE_IASTNODEVISITOR_H
#define FE_IASTNODEVISITOR_H

class ASTNode;

/**
 * Interface for AST node visitors.
 */
class IASTNodeVisitor {
private:
	IASTNodeVisitor(const IASTNodeVisitor &other);
	IASTNodeVisitor& operator=(const IASTNodeVisitor &rhs);

public:
	/** Constructor. */
	IASTNodeVisitor();

	/** Destructor. */
	virtual ~IASTNodeVisitor();

	/** Visit AST_STATEMENT_LIST node. */
	virtual void visitStatementList(ASTNode * n) = 0;
	/** Visit AST_STATEMENT node. */
	virtual void visitStatement(ASTNode * n) = 0;
	/** Visit AST_WHILE_STATEMENT node. */
	virtual void visitWhileStatement(ASTNode * n) = 0;
	/** Visit AST_IF_STATEMENT node. */
	virtual void visitIfStatement(ASTNode * n) = 0;
	/** Visit AST_BINARY_OP_EXPR node. */
	virtual void visitBinaryOpExpr(ASTNode * n) = 0;
	/** Visit AST_UNARY_OP_EXPR node. */
	virtual void visitUnaryOpExpr(ASTNode * n) = 0;
	/** Visit AST_FIELD_REF_EXPR node. */
	virtual void visitFieldRefExpr(ASTNode * n) = 0;
	/** Visit AST_METHOD_CALL_EXPR node. */
	virtual void visitMethodCallExpr(ASTNode * n) = 0;
	/** Visit AST_MODULE_METHOD_CALL_EXPR node. */
	virtual void visitModuleMethodCallExpr(ASTNode * n) = 0;
	/** Visit AST_VAR_REF_EXPR node. */
	virtual void visitVarRefExpr(ASTNode * n) = 0;
	/** Visit AST_INT_LITERAL_EXPR node. */
	virtual void visitIntLiteralExpr(ASTNode * n) = 0;
	/** Visit AST_BOOLEAN_LITERAL_EXPR node. */
	virtual void visitBooleanLiteralExpr(ASTNode *n) = 0;
	/** Visit AST_SYMBOL_LITERAL_EXPR node. */
	virtual void visitSymbolLiteralExpr(ASTNode * n) = 0;
	/** Visit AST_STRING_LITERAL_EXPR node. */
	virtual void visitStringLiteralExpr(ASTNode * n) = 0;
	/** Visit AST_SELF_REF_EXPR node. */
	virtual void visitSelfRefExpr(ASTNode * n) = 0;
	/** Visit AST_NEW_EXPR node. */
	virtual void visitNewExpr(ASTNode * n) = 0;
	/** Visit AST_CLASS node. */
	virtual void visitClass(ASTNode * n) = 0;
	/** Visit AST_MODULE node. */
	virtual void visitModule(ASTNode * n) = 0;
	/** Visit AST_MEMBER_LIST node. */
	virtual void visitMemberList(ASTNode * n) = 0;
	/** Visit AST_METHOD node. */
	virtual void visitMethod(ASTNode * n) = 0;
	/** Visit AST_MAGIC_METHOD node. */
	virtual void visitMagicMethod(ASTNode * n) = 0;
	/** Visit AST_FIELD node. */
	virtual void visitField(ASTNode * n) = 0;
	/** Visit AST_VAR_LIST node. */
	virtual void visitVarList(ASTNode * n) = 0;
	/** Visit AST_VAR node. */
	virtual void visitVar(ASTNode * n) = 0;
	/** Visit AST_ARG_LIST node. */
	virtual void visitArgList(ASTNode * n) = 0;
	/** Visit AST_UNIT node. */
	virtual void visitUnit(ASTNode * n) = 0;
	/** Visit AST_IMPORT_LIST node. */
	virtual void visitImportList(ASTNode * n) = 0;
	/** Visit AST_IMPORT node. */
	virtual void visitImport(ASTNode * n) = 0;
	/** Visit AST_STATIC_IMPORT node. */
	virtual void visitStaticImport(ASTNode *n) = 0;
	/** Visit AST_RETURN_STATEMENT node. */
	virtual void visitReturnStatement(ASTNode * n) = 0;
	/** Visit AST_NIL_EXPR node. */
	virtual void visitNilExpr(ASTNode * n) = 0;
};


#endif /* FE_IASTNODEVISITOR_H */
